package cn.swust.score.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import cn.swust.score.basepojo.ResultResponse;
import cn.swust.score.dao.DelDataDao;
import io.swagger.annotations.Api;

@Api(tags = "清除所有数据")
@RestController
@RequestMapping("/admin")
public class DelController {
	@Autowired 
	private DelDataDao deleteDao;
	@GetMapping("/del")
	public ResultResponse<Integer> deleteScore(){
		deleteDao.deleteGrade();
		deleteDao.deleteStage();
		deleteDao.updateRater();
		return new ResultResponse<Integer>(0,"OK", 1);
	}
	@GetMapping("/delAll")
	public ResultResponse<Integer> deleteAll(){
		deleteDao.deleteCandidate();
		deleteDao.deleteGrade();
		deleteDao.deleteRater();
		deleteDao.deleteStage();
		deleteDao.alterCandidate();
		deleteDao.alterRater();
		return new ResultResponse<Integer>(0,"OK", 1);
	}
}
